package com.lb.trac.controller.common.loaders;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lb.trac.pojo.TipoIntervento;
import com.lb.trac.service.SearchService;

public class LoadTipiIntervento implements HttpObjectsLoader {

	private SearchService searchService;

	public void load(HttpServletRequest request, HttpServletResponse response) {
		TipoIntervento[] ti = (TipoIntervento[]) request.getSession(false).getAttribute("listaTipiInterventi");
		if(ti==null){
			ti = getSearchService().find(new TipoIntervento[0], TipoIntervento.class);
			request.getSession(false).setAttribute("listaTipiInterventi", ti);
		}
			 
		
	}
	
	public SearchService getSearchService() {
		return searchService;
	}

	public void setSearchService(SearchService searchService) {
		this.searchService = searchService;
	}


}
